index.html.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <!-- 页面头部 -->
  3. <HomePageHead></HomePageHead>
  4. <!-- 导航栏 -->
  5. <HomePageNavigation></HomePageNavigation>
  6. <!-- 面包屑导航 -->
  7. <div class="breadcrumb">
  8. <div class="inner">
  9. <span class="location">您的位置:</span>
  10. <el-breadcrumb :separator-icon="ArrowRight">
  11. <el-breadcrumb-item>
  12. <NuxtLink to="/">首页</NuxtLink>
  13. </el-breadcrumb-item>
  14. <el-breadcrumb-item>
  15. {{ newsDetail.con_title }}
  16. </el-breadcrumb-item>
  17. </el-breadcrumb>
  18. </div>
  19. </div>
  20. <!-- 资讯列表 -->
  21. <div class="newsDetail">
  22. <div class="inner">
  23. <div class="innerRight">
  24. <ul>
  25. <li v-for="(item, index) in bottomMenu" :key="index">
  26. <NuxtLink v-if="item.type == 0" :to="`/about/${item.name_pinyin}/index.html`" :title="item.name"
  27. :class="item.id == pageId ? 'active' : ''">
  28. {{ item.name }}
  29. </NuxtLink>
  30. <NuxtLink v-else-if="item.type == 1" :to="`/about/${item.name_pinyin}/list-1.html`"
  31. :title="item.name" :class="item.id == pageId ? 'active' : ''">
  32. {{ item.name }}
  33. </NuxtLink>
  34. </li>
  35. </ul>
  36. </div>
  37. <div class="innerLeft">
  38. <div class="leftBottomImg" v-if="newsDetail.con_title == '会员服务'">
  39. <img src="../../../public/index/hyfw.jpg" alt="">
  40. </div>
  41. <div class="leftBottomImg" v-if="newsDetail.con_title == '联系我们'">
  42. <img src="../../../public/index/lxwm.jpg" alt="">
  43. </div>
  44. <div class="leftBottomImg" v-if="newsDetail.con_title == '法制项目简介'">
  45. <img src="../../../public/index/xmwzjj.png" alt="">
  46. </div>
  47. <div class="leftBottomImg" v-if="newsDetail.con_title == '免责声明'">
  48. <img src="../../../public/index/mzsm.png" alt="">
  49. </div>
  50. <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
  51. </div>
  52. <div style="clear: both;"></div>
  53. </div>
  54. </div>
  55. <!-- 页面底部 -->
  56. <HomeFoot></HomeFoot>
  57. </template>
  58. <script setup>
  59. //1.页面依赖 start ---------------------------------------->
  60. import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
  61. import { ArrowRight } from '@element-plus/icons-vue'
  62. import { ref, onMounted } from 'vue';
  63. //获得跳转过来的id
  64. const route = useRoute();
  65. //获得当前的完整路径
  66. const fullPath = route.path;
  67. //拆分,取出来中间这一段,然后提取数字部分
  68. const segments = fullPath.split('/');
  69. const targetSegment = segments[2];
  70. //const numberPart = targetSegment.match(/\d+$/)?.[0];
  71. let articleId;
  72. let pageId;
  73. //通过导航路径反向查询导航id
  74. const getRouteId = await requestDataPromise('/web/getWebsiteRoute', {
  75. method: 'GET',
  76. query: {
  77. 'foot_pinyin': targetSegment,
  78. },
  79. });
  80. if (getRouteId.code == 200) {
  81. articleId = getRouteId.data.id;
  82. pageId = getRouteId.data.id;
  83. } else {
  84. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  85. // console.log("错误位置:通过url路径查询导航池id")
  86. // console.log("后端错误反馈:",getRouteId.message)
  87. // console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  88. }
  89. //1.页面依赖 end ---------------------------------------->
  90. //2.页面数据 start ---------------------------------------->
  91. //广告列表
  92. const adList = ref([]);
  93. let adImg1 = ref([]);
  94. let adImg2 = ref([]);
  95. async function getAdData() {
  96. const adData = await requestDataPromise('/web/getWebsiteAdvertisement', { method: 'GET', query: { 'ad_tag': 'PAGE' } });
  97. adList.value = adData.data;
  98. if (adData.code == 200) {
  99. for (let item of adData.data) {
  100. if (item.ad_tag == 'PAGE_0001') {
  101. adImg1.value = item;
  102. }
  103. if (item.ad_tag == 'PAGE_0002') {
  104. adImg2.value = item;
  105. }
  106. }
  107. } else {
  108. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  109. console.log("错误位置:获取详情页广告列表")
  110. console.log("后端错误反馈:", adData.message)
  111. console.log("SSR waring ---------- SSR waring ---------- SSR waring ---------->")
  112. }
  113. }
  114. getAdData();
  115. const newsDetail = ref({})
  116. const bottomMenu = ref([]);
  117. async function getPageData() {
  118. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
  119. method: 'GET',
  120. query: {
  121. 'fcat_id': articleId
  122. },
  123. });
  124. newsDetail.value = mkdata.data;
  125. }
  126. getPageData();
  127. async function getPageMenu() {
  128. const mkdata = await requestDataPromise('/web/getWebsiteFooterCategory', {
  129. method: 'GET',
  130. query: {},
  131. });
  132. bottomMenu.value = mkdata.data;
  133. }
  134. getPageMenu();
  135. //2.页面数据 end ---------------------------------------->
  136. //4.设置seo信息 start---------------------------------------->
  137. //4.1 设置seo信息
  138. const setData = await requestDataPromise('/web/getWebsiteFootInfo', {
  139. method: 'GET',
  140. query: {},
  141. });
  142. let seoTitle = setData.data.website_head.title;
  143. let seoDescription = setData.data.website_head.description;
  144. let seoKeywords = setData.data.website_head.keywords;
  145. let seoSuffix = setData.data.website_head.suffix;
  146. let seoName = setData.data.website_head.website_name;
  147. useSeoMeta({
  148. title: seoTitle + "_" + seoSuffix,
  149. meta: [
  150. { name: 'description', content: seoDescription + "_" + seoName + "_" + seoSuffix, tagPriority: 10 },
  151. { name: 'keywords', content: seoKeywords + "_" + seoName + "_" + seoSuffix, tagPriority: 10 }
  152. ]
  153. });
  154. //4.设置seo信息 end---------------------------------------->
  155. onMounted(async () => {
  156. //从客户端获取行政职能部门 加快打开速度
  157. const { $webUrl, $CwebUrl } = useNuxtApp();
  158. //广告1
  159. let url = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0001`
  160. const responseAd1 = await fetch(url, {
  161. headers: {
  162. 'Content-Type': 'application/json',
  163. 'Userurl': $CwebUrl,
  164. 'Origin': $CwebUrl
  165. }
  166. });
  167. const resultAd1 = await responseAd1.json();
  168. adImg1.value = resultAd1.data[0];
  169. //广告2
  170. let url2 = `${$webUrl}/web/getWebsiteAdvertisement?ad_tag=snzxw_page_0002`
  171. const responseAd2 = await fetch(url2, {
  172. headers: {
  173. 'Content-Type': 'application/json',
  174. 'Userurl': $CwebUrl,
  175. 'Origin': $CwebUrl
  176. }
  177. });
  178. const resultAd2 = await responseAd2.json();
  179. adImg2.value = resultAd2.data[0];
  180. })
  181. </script>
  182. <style lang="less" scoped>
  183. //导航条
  184. .breadcrumb {
  185. width: 100%;
  186. .inner {
  187. width: 1200px;
  188. margin: 10px auto;
  189. border-bottom: 1px solid #E5E5E5;
  190. }
  191. .el-breadcrumb::v-deep {
  192. display: inline-block;
  193. vertical-align: -4px;
  194. }
  195. .el-breadcrumb__inner a::v-deep,
  196. .el-breadcrumb__inner.is-link::v-deep {
  197. color: #666666;
  198. font-weight: 400;
  199. text-decoration: none;
  200. transition: var(--el-transition-color);
  201. }
  202. span {
  203. font-family: "宋体";
  204. font-weight: 400;
  205. font-size: 14px;
  206. color: #666666;
  207. line-height: 40px;
  208. text-align: left;
  209. font-style: normal;
  210. text-transform: none;
  211. }
  212. .location {
  213. margin-right: 10px;
  214. display: inline-block;
  215. height: 40px;
  216. line-height: 40px;
  217. font-family: "宋体";
  218. font-weight: 400;
  219. font-size: 14px;
  220. color: #666666;
  221. vertical-align: 11px;
  222. }
  223. }
  224. // 资讯列表
  225. .newsDetail {
  226. width: 100%;
  227. margin-bottom: 70px;
  228. .inner {
  229. width: 1200px;
  230. font-size: 16px;
  231. .innerLeft {
  232. width: 980px;
  233. float: right;
  234. .LeftTop {
  235. margin-top: 50px;
  236. >h1 {
  237. line-height: 40px;
  238. margin-bottom: 30px;
  239. font-family: Microsoft YaHei, Microsoft YaHei;
  240. font-weight: bold;
  241. font-size: 30px;
  242. color: #333333;
  243. }
  244. >p {
  245. height: 18px;
  246. line-height: 18px;
  247. font-family: Microsoft YaHei, Microsoft YaHei;
  248. font-weight: 400;
  249. font-size: 14px;
  250. color: #999999;
  251. span {
  252. margin-right: 40px;
  253. }
  254. }
  255. >img {
  256. width: 680px;
  257. height: 382px;
  258. padding: 50px 0px 60px 55px;
  259. }
  260. }
  261. .leftBottomImg {
  262. width: 760px;
  263. height: 184px;
  264. margin: 0 auto;
  265. }
  266. .leftBottom {
  267. width: 92%;
  268. font-size: 20px;
  269. padding-top: 40px;
  270. margin: 0 auto;
  271. font-family: "微软雅黑", Microsoft YaHei;
  272. line-height: 36px;
  273. >h3,
  274. >p {
  275. text-indent: 2em;
  276. width: 790px;
  277. font-family: "微软雅黑", Microsoft YaHei;
  278. font-size: 20px;
  279. color: #333333;
  280. line-height: 23px;
  281. padding-bottom: 30px;
  282. }
  283. >h3 {
  284. font-weight: 600px;
  285. }
  286. >p {
  287. font-weight: 400;
  288. }
  289. }
  290. }
  291. .innerRight {
  292. width: 200px;
  293. margin-top: 20px;
  294. font-family: "微软雅黑";
  295. ul {
  296. li {
  297. a {
  298. display: block;
  299. height: 50px;
  300. line-height: 50px;
  301. color: #000;
  302. background: #f3f3f3;
  303. font-size: 18px;
  304. text-decoration: none;
  305. padding-left: 35px;
  306. box-sizing: border-box;
  307. border-bottom: 1px solid #fff;
  308. }
  309. }
  310. }
  311. .active {
  312. border-left: 0;
  313. background: #3395e4;
  314. color: #fff;
  315. }
  316. }
  317. }
  318. }
  319. </style>
  320. <style lang="less" scoped>
  321. @media screen and (min-width:801px) {
  322. .pc_none {
  323. display: none;
  324. }
  325. }
  326. @media screen and (max-width:800px) {
  327. /*ipad_phone*/
  328. .breadcrumb {
  329. margin-bottom: 11px;
  330. }
  331. .breadcrumb .location {
  332. font-size: 14px;
  333. }
  334. .breadcrumb span {
  335. font-size: 14px;
  336. }
  337. .breadcrumb /deep/.el-breadcrumb {
  338. vertical-align: middle;
  339. }
  340. .newsDetail {
  341. margin: 10px auto 0px;
  342. }
  343. .newsDetail .inner {
  344. width: 92%;
  345. margin: 0px auto 11px;
  346. overflow: hidden;
  347. }
  348. .newsDetail .inner .innerRight {
  349. width: 24%;
  350. display: none;
  351. }
  352. .newsDetail .inner .innerRight .rightMenuTitle {
  353. width: 100%;
  354. height: auto;
  355. background-size: 100% 155%;
  356. margin-bottom: 11px;
  357. display: block;
  358. width: 100%;
  359. height: auto;
  360. line-height: 33px;
  361. font-size: 14px;
  362. text-align: center;
  363. }
  364. .newsDetail .inner .innerRight ul {
  365. display: block;
  366. width: 100%;
  367. height: auto;
  368. }
  369. .newsDetail .inner .innerRight ul li {
  370. display: block;
  371. width: 100%;
  372. height: auto;
  373. }
  374. .newsDetail .inner .innerRight ul li a {
  375. line-height: 20px;
  376. height: auto;
  377. font-size: 12px;
  378. margin-bottom: 5px;
  379. padding: 6px 2px;
  380. box-sizing: border-box;
  381. border-left: 2px solid #028E21;
  382. }
  383. .newsDetail .inner .innerLeft {
  384. width: 100%;
  385. float: none;
  386. overflow: hidden;
  387. margin: 0;
  388. }
  389. .newsDetail .inner .innerLeft .book_son_right {
  390. float: none;
  391. width: 100%;
  392. overflow: hidden;
  393. margin-bottom: 22px;
  394. }
  395. .newsDetail .inner .innerLeft .leftBottomTitle {
  396. height: 50px;
  397. line-height: 50px;
  398. font-size: 18px;
  399. }
  400. .newsDetail .inner .innerLeft .leftBottom {
  401. width: 100%;
  402. padding-top: 11px;
  403. line-height: 22px;
  404. font-size: 16px !important;
  405. }
  406. .newsDetail .inner .innerLeft .leftBottom * {
  407. line-height: 44px;
  408. font-size: 26px !important;
  409. }
  410. .leftBottom /deep/.daohang ul {
  411. overflow: hidden;
  412. }
  413. .leftBottom /deep/.daohang li {
  414. float: left;
  415. margin: 1%;
  416. box-sizing: border-box;
  417. border: solid 1px #ddd;
  418. padding: 1vw;
  419. width: 23%;
  420. text-align: center;
  421. }
  422. .leftBottom /deep/.daohang li a {
  423. font-size: 14px !important;
  424. color: #333;
  425. }
  426. .phone_none {
  427. display: none;
  428. }
  429. }
  430. .breadcrumb {
  431. width: 1400PX;
  432. margin: 0px auto 0px;
  433. }
  434. .el-breadcrumb {
  435. height: 22PX;
  436. line-height: 22PX;
  437. }
  438. .breadcrumb .inner span.location {
  439. font-size: 16PX;
  440. ;
  441. height: 22PX;
  442. ;
  443. line-height: 22PX;
  444. font-weight: normal;
  445. }
  446. .breadcrumb .inner {
  447. width: 100%;
  448. word-break: keep-all;
  449. white-space: nowrap;
  450. box-sizing: border-box;
  451. padding: 0px 10px 11px;
  452. overflow: hidden;
  453. }
  454. .breadcrumb .inner * {
  455. float: left;
  456. }
  457. .breadcrumb .inner a {
  458. font-size: 16PX;
  459. ;
  460. height: 22PX;
  461. line-height: 22PX;
  462. display: inline-block;
  463. font-weight: normal;
  464. }
  465. .breadcrumb .phone_breadcrumb_text /deep/.el-breadcrumb__inner {
  466. font-size: 16PX;
  467. ;
  468. height: 22PX;
  469. line-height: 22PX;
  470. font-weight: normal;
  471. }
  472. .breadcrumb:deep(.el-icon) {
  473. width: 16PX;
  474. height: 16PX;
  475. }
  476. .breadcrumb .inner span {
  477. font-size: 16PX;
  478. ;
  479. height: 22PX;
  480. line-height: 22PX;
  481. }
  482. .newsDetail {
  483. box-sizing: border-box;
  484. overflow: hidden;
  485. width: 1400PX;
  486. margin: 0px auto 0px;
  487. }
  488. .newsDetail .inner {
  489. display: block;
  490. overflow: hidden;
  491. width: 100%;
  492. display: flex;
  493. }
  494. .newsDetail .inner .innerRight {
  495. overflow: hidden;
  496. width: 222PX;
  497. float: left;
  498. margin: 0px 10px 0px 0px;
  499. height: auto;
  500. }
  501. .newsDetail .inner .innerLeft {
  502. overflow: hidden;
  503. margin: 0;
  504. flex: 1;
  505. float: right;
  506. }
  507. .newsDetail .inner .innerRight ul li a {
  508. line-height: 44PX;
  509. height: 44PX;
  510. padding-left: 22PX;
  511. font-size: 16PX;
  512. }
  513. .newsDetail .inner .innerLeft .leftBottomImg {
  514. width: 100%;
  515. height: auto;
  516. text-align: center;
  517. }
  518. .newsDetail .inner .innerLeft .leftBottomImg img {
  519. display: inline-block;
  520. width: 90%;
  521. height: auto;
  522. }
  523. .newsDetail .inner .innerLeft .leftBottom {
  524. line-height: 16px;
  525. }
  526. .leftBottom :deep(.daohang) ul {
  527. overflow: hidden;
  528. margin-bottom: 33px;
  529. }
  530. .leftBottom :deep(.daohang) ul li {
  531. float: left;
  532. margin: 1%;
  533. border: solid 1px #ddd;
  534. }
  535. .leftBottom :deep(.daohang) ul li a {
  536. display: block;
  537. padding: 0 6PX;
  538. text-align: center;
  539. line-height: 33PX !important;
  540. height: 33PX;
  541. font-size: 16PX;
  542. color: #333;
  543. }
  544. @media screen and (min-width: 1401px) {
  545. //你的样式
  546. }
  547. @media screen and (max-width: 1400px) {
  548. .breadcrumb {
  549. width: 100%;
  550. margin: 0px auto 0px;
  551. box-sizing: border-box;
  552. padding: 0px 10px;
  553. }
  554. .newsDetail {
  555. width: 100%;
  556. margin: 0px auto 0px;
  557. box-sizing: border-box;
  558. padding: 0px 10px;
  559. }
  560. }
  561. @media screen and (min-width: 801px) and (max-width: 1400px) {
  562. //你的样式
  563. }
  564. @media screen and (max-width: 800px) {
  565. //你的样式
  566. .breadcrumb:deep(.el-icon) {}
  567. .breadcrumb .inner span.location,
  568. .breadcrumb .inner span {
  569. font-size: 24px;
  570. }
  571. .breadcrumb .inner a {
  572. font-size: 24px;
  573. height: 55px;
  574. line-height: 55px;
  575. }
  576. .breadcrumb .phone_breadcrumb_text :deep(.el-breadcrumb__inner) {
  577. font-size: 24px;
  578. height: 55px;
  579. line-height: 55px;
  580. }
  581. }
  582. </style>